var t = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), e = require("../../@babel/runtime/helpers/asyncToGenerator"), n = getApp();

Page({
    data: {
        cityArr: []
    },
    onLoad: function(t) {
        var e = this, n = new Map([ [ "cake", {
            url: "plugin.yz-supply-cake.frontend.index.index.getCity",
            nextEndPage: function() {
                wx.navigateTo({
                    url: "/packageF/sachertorte/sachertorteIndex/sachertorteIndex?city=" + e.cityName
                });
            }
        } ] ]);
        this.apiOptions = n.get(this.options.plu), this.getData();
    },
    getData: function() {
        var a = this;
        return e(t.default.mark(function e() {
            var i;
            return t.default.wrap(function(t) {
                for (;;) switch (t.prev = t.next) {
                  case 0:
                    i = n.getNetAddresss(a.apiOptions.url), n._postNetWork({
                        url: i,
                        data: {
                            name: a.cityName
                        },
                        success: function(t) {
                            var e = t.data;
                            1 == e.result ? a.setData({
                                cityArr: e.data
                            }) : n.tips(e.msg);
                        },
                        fail: function(t) {
                            console.log(t);
                        }
                    });

                  case 2:
                  case "end":
                    return t.stop();
                }
            }, e);
        }))();
    },
    RelatedSites: function(t) {
        var e = t.target.dataset.item.city;
        this.cityName = e, this.apiOptions.nextEndPage();
    },
    onSearch: function() {
        this.getData();
    },
    onChange: function(t) {
        this.cityName = t.detail;
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});